//
//  CYUIView_Tabbar.h
//  Edu_iOS
//
//  Created by yanyan on 2017/9/19.
//  Copyright © 2017年 yanyan. All rights reserved.
//
#import "CYUICVCell_base.h"
extern NSString *CYTabIndicatorViewHeight;
extern NSString *CYTabIndicatorViewWidth;

extern NSString *CYTabIndicatorColor;
extern NSString *CYTabBoxBackgroundColor;
extern NSString *CYTabIndicatorCornerRadius;
@class CYUIView_Tabbar;
typedef void (^Block_Indexpath) (NSIndexPath  * _Nonnull indexPath);

@interface CYUICVCell_Tabbar : CYUICVCell_base

@property (strong, nonatomic, nullable) UIColor *textColor;

@property (strong, nonatomic, nullable) UIFont *textFont;

@property (strong, nonatomic, nullable) UIColor *selectedTextColor;

@property (strong, nonatomic, nullable) UIFont *selectedTextFont;

@property (nonatomic, copy, nullable) NSString *title;

@end
#import "CYUIView_base.h"
typedef NS_ENUM(NSInteger,CYTabbarSelectionType) {
    CYTabbarSelectionIndicator,
    CYTabbarSelectionBox,
};

typedef NS_ENUM(NSInteger, CYTabbarIndicatorType) {
    CYTabbarIndicatorLocationDown,
    CYTabbarIndicatorLocationUp,
    CYTabbarIndicatorLocationNone
};
@protocol CYTabbarViewDatasource <NSObject>
@required
- (NSArray<NSString *> *)tabbarTitlesForTabbarView:(CYUIView_Tabbar *)tabbarView;

@end

@interface CYUIView_Tabbar : CYUIView_base
@property (strong, readonly) UIView * bottomView;

@property(nonatomic,weak) id<CYTabbarViewDatasource> dataSource;
@property(nonatomic,strong)Block_Indexpath _Nullable block_IndexPathSelected;
@property(nonatomic,assign)BOOL indicatorEqualTitleWidth;//是否和 title等宽
/**
 Whether the user need color Gradient,Default is true
 */
@property (assign, nonatomic) BOOL needTextGradient;

/**
 Specifies the type of selection
 Default is CMTabbarSelectionIndicator
 */
@property (assign, nonatomic) CYTabbarSelectionType selectionType;
/**
 Specifies the type of indication
 Default is CMTabbarIndicatorLocationDown
 */
@property (assign, nonatomic) CYTabbarIndicatorType locationType;
/**
 The attributes for the tab indicator(CMTabIndicatorViewHeight,CMTabIndicatorColor,CMTabBoxBackgroundColor)
 */
@property (strong, nonatomic) NSDictionary * _Nullable indicatorAttributes;
/**
 The attributes for tabs (NSForegroundColorAttributeName, NSFontAttributeName, NSBackgroundColorAttributeName)
 */
@property (strong, nonatomic) NSDictionary * _Nullable normalAttributes;
/**
 The attributes for selected tabs (NSForegroundColorAttributeName, NSFontAttributeName, NSBackgroundColorAttributeName)
 */
@property (strong, nonatomic) NSDictionary * _Nullable selectedAttributes;
/**
 Whether the user can scroll the tabbar
 */
@property (assign, nonatomic) BOOL scrollEnable;
/**
 padding Value,Default is 5.0
 */
@property (assign, nonatomic) CGFloat tabPadding;
/**
 User default index
 */
@property (assign, nonatomic) NSUInteger defaultSelectedIndex;
/**
 Content Inset
 */
@property (assign, nonatomic) UIEdgeInsets contentInset;
/**
 The tab offsetX of the View.
 */
@property (assign, nonatomic) CGFloat tabbarOffsetX;
/**
 Set the current selected tab
 
 @param index index
 @param animated animated
 */
@property(nonatomic,readonly)NSInteger selectedIndex;
- (void)setTabIndex:(NSInteger)index animated:(BOOL)animated;

- (void)reloadData;


@end
